<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="/assets/js/maps.js"></script>
<script type="text/javascript">
$(function(){
	$('#nav-index').addClass("now");
	$('#enter').tabs();
	$('#enter').tabs("rotate" , 3000);
});

/* google map */

function initmap(div) {
	
	var mapOptions = {
		zoom: 16,
		center: tkk,
		mapTypeControl: false,
		mapTypeId: google.maps.MapTypeId.SATELLITE
	};
	
	map = new google.maps.Map(document.getElementById(div), mapOptions);
	
	var ControlDiv = document.createElement('DIV');
	new Control(ControlDiv, "默认视图", showHome);
	map.controls[google.maps.ControlPosition.TOP_RIGHT].push(ControlDiv);
	
	infowindow = new google.maps.InfoWindow();
	
	$(function(){
		$.get("/mapdata",{},function(data){
			$(data).find("data > item").each(function(){ 
				var item = [$(this).text(),$(this).attr("id"),$(this).attr("name")];
				mapdatas.push(item);
			});	
			addMarks(mapdatas);
		});
	});
}

window.onload = function(){
	initmap("index_map_canvas");
}
</script>
<!-- intro -->
<div id="intro" class="contentLeft message">
	欢迎使用拾客失物招领系统！<a href="help.php">学习如何使用...</a>
</div>
<!-- enter -->
<div id="enter" class="contentLeft">
	<ul>
		<li><a href="#tabs-1">我丢了东西</a></li>
		<li><a href="#tabs-2">我捡了东西</a></li>
		<li><a href="#tabs-3">想写感谢信</a></li>
	</ul>
	<div id="tabs-1">
		有<em><?php echo $view['lostcount']?></em>件物品遗失，其中<em><?php echo $view['getbackcount']?></em>件已找回！<a href="/post/lost" class="postit">我要登记</a>
	</div>
	<div id="tabs-2">
		有<em><?php echo $view['foundcount']?></em>件物品被捡到，其中<em><?php echo $view['returncount']?></em>件已归还！<a href="/post/found" class="postit">我要提交</a>
	</div>
	<div id="tabs-3">
		有<em>0</em>封感谢信友情传递中！<a href="#" class="postit">暂未开放</a>
	</div>
</div>
<!-- tagcloud -->
<div id="tagcloud" class="contentRight">
	<h3>标签</h3>
	<?php echo view::show('tags/show', array('tags'=>$view['tags']))?>
	<div class="clearBoth"></div>
</div>
<!-- google map -->
<div id="index_map_canvas" class="contentLeft"></div>